<?php
include('template.php');

$playerID = $_GET['id'];
if (is_numeric($playerID))
{
	if (makeSelection($playerID, $_SESSION['team'], $_SESSION['draft']))
	{
		echo "<h2> Thanks for your selection! </h2>";
		$_SESSION['draft'] = getDraft($_SESSION['draft']->id);
	}
	else if ($_SESSION['user']->role == "admin")
	{
		makeSelection($playerID, findTeamFromDraftOrder($_SESSION['draft']), $_SESSION['draft']);
	}
	else
	{
		echo "<h2> Please wait your turn </h2>";
	}
}
?>

</body>
</html>
